package com.learn.micro_mall.common.util;

import com.learn.micro_mall.common.response.PlainResult;

public class PlainResultUtils {

    public static  <T> PlainResult<T> success(T data){
        PlainResult<T> result = new PlainResult<>();
        result.setSuccess(true);
        result.setData(data);
        return result;
    }

    public static PlainResult fail(String failReason){
        PlainResult result = new PlainResult();
        result.setFailReason(failReason);
        result.setSuccess(false);
        return result;
    }
}
